package abq2.jic.jic.plugin.operate.askForLeave;

import com.alibaba.fastjson.JSONObject;
import kd.bos.form.gpt.IGPTAction;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 用于获取现在的时间
 */
public class GetTimeNow implements IGPTAction {
    @Override
    public Map<String, String> invokeAction(String action, Map<String, String> map) {
        Map<String , String> result = new HashMap<>();
        //如果操作名称相等
        if ("GET_Time_Now".equalsIgnoreCase(action)) {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("now",new Date());
            result.put("result",jsonObject.toJSONString());
        }
        return result;

    }
}
